#pragma once
#include <iostream>
#include <chrono>

class Time
{
public:
    static int64_t GetCurTimeMilliseconds()
    {
        auto now = std::chrono::system_clock::now();

        // 将时间点转换为时间戳（秒）
        std::time_t now_time_t = std::chrono::system_clock::to_time_t(now);

        std::cout << "Current timestamp (seconds since Unix epoch): " << now_time_t << std::endl;

        // 如果你需要更高精度的时间戳（例如，以毫秒为单位）
        auto now_duration = now.time_since_epoch();
        auto milliseconds = std::chrono::duration_cast<std::chrono::milliseconds>(now_duration).count();

        std::cout << "Current timestamp (milliseconds since Unix epoch): " << milliseconds << std::endl;

        return milliseconds;
    }

    static std::chrono::time_point<std::chrono::high_resolution_clock> GetCurTime()
    {
        auto now = std::chrono::high_resolution_clock::now();


        return now;
        // // 将时间点转换为时间戳（秒）
        // std::time_t now_time_t = std::chrono::system_clock::to_time_t(now);
        // return now_time_t;
    }

    static time_t GetCurTimeStamp()
    {


        return time(nullptr);
        // // 将时间点转换为时间戳（秒）
        // std::time_t now_time_t = std::chrono::system_clock::to_time_t(now);
        // return now_time_t;
    }
};